import requests
# from curl_cffi import requests
from lxml import etree
import re


url = 'https://baike.baidu.com/starmap/api/collectinfo?encodeRelId=baf19538c48eda20782eb545&pn=1&rn=50&productId=1'
# headers = {
#     "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
#     "accept-encoding": "gzip, deflate, zstd",
#     "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
#     "cache-control": "no-cache",
#     "connection": "keep-alive",
#     "cookie": "PHPSESSID=u6thte6jsbe97i040oki39jnl2; Hm_lvt_78ed266823c0c44d80d10ec5f75e9bbe=1761984043; HMACCOUNT=DDE96B9C8A5564BC; Hm_lpvt_78ed266823c0c44d80d10ec5f75e9bbe=1761984070",
#     "host": "qcwxw123.com",
#     "pragma": "no-cache",
#     "referer": "https://qcwxw123.com/portal/letter/list/category_id/3/parent_id/2.html",
#     "sec-ch-ua": "\"Microsoft Edge\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
#     "sec-ch-ua-mobile": "?0",
#     "sec-ch-ua-platform": "\"Windows\"",
#     "sec-fetch-dest": "document",
#     "sec-fetch-mode": "navigate",
#     "sec-fetch-site": "same-origin",
#     "sec-fetch-user": "?1",
#     "upgrade-insecure-requests": "1",
#     "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0"
# }
headers ={
    # "cookie": "PHPSESSID=u6thte6jsbe97i040oki39jnl2; Hm_lvt_78ed266823c0c44d80d10ec5f75e9bbe=1761984043; HMACCOUNT=DDE96B9C8A5564BC; Hm_lpvt_78ed266823c0c44d80d10ec5f75e9bbe=1761984070",
    # "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0",
    # "referer": "https://baike.baidu.com/starmap/view?",
    "cookie": "BIDUPSID=2D722FEA8B183DFA7FA2342B6E114D86; PSTM=1730277964; BAIDUID=36A30281270423A6B0419F1E0504FC19:FG=1; BDUSS=GVEaWctdVE5bWd3VFNobTZjdE9SWld0WmxnOUpoUVpGcWpxQUlmSFk5VEN6SjVuSVFBQUFBJCQAAAAAAQAAAAEAAABwDTVnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMI~d2fCP3dnV; BDUSS_BFESS=GVEaWctdVE5bWd3VFNobTZjdE9SWld0WmxnOUpoUVpGcWpxQUlmSFk5VEN6SjVuSVFBQUFBJCQAAAAAAQAAAAEAAABwDTVnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMI~d2fCP3dnV; MAWEBCUID=web_YUuyDsTtiPtwTyabywReovmedBDQZtucToWgijRsGzuLfeLmyj; H_WISE_SIDS_BFESS=110085_651903_652167_654175_654380_654665_654818_655049_655483_655580_655576_655670_655646_655723_654483_655856_656054_656069_656174_656324_656339_654043_654016_656466_656548_656348_656661_656696; BAIDUID_BFESS=36A30281270423A6B0419F1E0504FC19:FG=1; ZFY=kZQz93UoZJ0jqn8MtV:Aaik6H0pwFoBvx8wPvlLdESmc:C; baikedeclare=showed; BAIDU_WISE_UID=wapp_1761717978474_965; MCITY=-267%3A; RT=\"z=1&dm=baidu.com&si=b709104e-b954-412e-9100-b69408d5b0e0&ss=mhelnxdz&sl=8&tt=9ve&bcn=https%3A%2F%2Ffclog.baidu.com%2Flog%2Fweirwood%3Ftype%3Dperf&ld=8d0a&nu=9y8m6cy&cl=5zlm&ul=8kac&hd=8kag\"; BA_HECTOR=0hak0ha5a42h842h2485050l010la21kgb8mo25; H_WISE_SIDS=63145_64984_65243_65620_65628_65643_65650_65759_65783_65796_65851_65916_65918_65361_65942_65966_65959_65987_65392_66081_66039_66112_65866; zhishiTopicRequestTime=1762013718723; BDRCVFR[K6RW1DeE3Dm]=mk3SLVN4HKm; H_PS_PSSID=63145_64984_65243_65620_65628_65643_65650_65759_65783_65796_65851_65916_65918_65361_65942_65966_65959_65987_65392_66081_66039_66112_65866; delPer=0; PSINO=1; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; channel=baidusearch; ab_sr=1.0.1_NjA1YTU5Y2MwOGU2MTUyYjcwMzMwNjAwOGM4YjQyMTJlNmYwZTYwNDVlMzJlMWFmMDA5NWM2ZTk4MTU1ODhkYjlhMTk0ZWVlODc4YTYxMDFjNGU3MDQ2ZGI4ZjU4ZTBlZjQ5NTU5Y2FlNmJkMjMyMzAyMjdiZmZkMzNkMzE1MDZjMjA4MTViMTBmZTI4MGM1OGQ5Zjg3NDJjYjFmYjU4ODVhNzUwNDBiNjI5ZmFmNDc2ZmY0YTA2YzRhYmMyZjQ3ZWZjNjEyYzFkNGJmODFmNGUzNzQzMWI4MGI1MDM3Y2Y=; baikeVisitId=e0d0854d-bd59-48a9-95bf-72b80895aae5"
}
# params = {
#     "encodeRelId": "baf19538c48eda20782eb545",
#     "pn": "1",
#     "rn": "50",
#     "productId": "1"
# }
# res = requests.get(url,headers=headers)

session = requests.session()
res = session.get(url,headers= headers)
print(res.status_code)
print(res.json())




